<template>
  <div class="form-field" :class="{ 'form-field--inline': inline }">
    <label v-if="label" class="form-field__label">{{ label }}</label>
    <div class="form-field__content">
      <slot />
    </div>
  </div>
</template>

<script setup lang="ts">
interface Props {
  label?: string
  inline?: boolean
}

defineProps<Props>()
</script>

<style scoped>
.form-field {
  margin-bottom: 16px;
}

.form-field--inline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-field__label {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 8px;
  display: block;
}

.form-field--inline .form-field__label {
  margin-bottom: 0;
  min-width: 60px;
  flex-shrink: 0;
}

.form-field__content {
  flex: 1;
}
</style>
